// https://leetcode.cn/problems/factorial-trailing-zeroes/?envType=study-plan-v2&envId=top-interview-150

class Solution {
public:
    int trailingZeroes(int n) {
        int count = 0;
        for (int i = 5; i <= n; i += 5) {
            for (int j = i; j % 5 == 0; j /= 5) {
                count++;
            }
        }
        return count;
    }
};